home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
FNTPAK32.ZIP
/
C.EXE
/
DEMO_LIN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-16
|
3KB
|
103 lines
/*******************************************************************
Demo_Lin.C Copyright 1994, Rob W. Smetana
NOTE: Turn screen swapping ON if appropriate!
Font Pak demo program which shows how to:
1. Use SetMaxLines (...) to switch to 12 - 100 lines on
the screen -- in TEXT mode!
2. Load a Font Pak font (from 4 to 24 points) to finish
the process.
Requires:
a. A callable Font Pak font (e.g., Tiny04.F06)
b. Procedures in Lines.Obj (SetmaxLines, WriteChar, etc.)
********************************************************************/
#include <font_pak.h> /* for prototypes */
#include <dos.h> /* for int86 */
#include <conio.h>
#define Video 0x10 /* set text mode */
#define SetVMode 0
#define TextCO80 3
#define Char_Gen 0x11 /* select 43/50 lines */
#define Rom8x8 0x12
#define Block 0
void TextMode (void); /* local prototypes */
void Select43_50 (void);
int extern pascal far GETMONITOR(void);
void extern pascal far TINY04(int BlockNum);
int extern pascal far SETMAXLINES(int FontHeight);
void extern pascal far WRITECHAR (int Row, int Col, int AscCode, int Colr);
/***********************************************************************/
int main (void)
{
int LenString, CharHite, NumLines, Char, Row, Col, AsciiCode;
char s[40],l[3];
if (GETMONITOR() < 4) /* Bail out if no EGA/VGA */
{
printf ("Sorry. This demo requires an EGA, VGA or compatible monitor.");
return (-99);
}
strcpy (s, " Here's a new line. Press <enter>...");
TextMode(); /* set video mode; ensure text mode */
Select43_50(); /* get max # of lines */
CharHite = 6; /* tiny04 is a 4-point font in 6x8 grid */
NumLines = SETMAXLINES (CharHite);
TINY04 (0+100); /* re-map block 0 -- the default font */
/* BE SURE to add 100 to block # */
printf (" Using font Tiny04, we can get %d lines on the screen! ", NumLines);
for (Row = 3; Row <= NumLines; Row++)
{
for (Char = 1; Char<38; Char++)
{
AsciiCode = s[Char];
WRITECHAR (Row, 22+Char, AsciiCode, 79);
}
}
getch();
TextMode(); /* restore some normalcy */
return (0);
}
void TextMode (void)
{
union REGS reg;
reg.h.ah = SetVMode;
reg.h.al = TextCO80;
int86 (Video, ®, ®);
}
void Select43_50 (void)
{
union REGS reg;
reg.h.ah = Char_Gen;
reg.h.al = Rom8x8;
reg.h.bl = Block;
int86 (Video, ®, ®);
}